package com.iss.apartmentmanage.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.util.Collection;
import java.util.List;
@ApiModel("用户实体")
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("user")
public class User implements UserDetails {
    @TableId(type = IdType.AUTO)
    private Integer id;
    @ApiModelProperty("账户")
    private String uName;
    @ApiModelProperty("密码")
    private String uPwd;
    private String uPhone;
    private String status;
    private String isvip;
    //所有权限的存储
    private List<GrantedAuthority> authorityList;

    public User(String uName, String uPwd, List<GrantedAuthority> authorityList) {
        this.uName = uName;
        this.uPwd = uPwd;
        this.authorityList = authorityList;
    }

    @Override
    public Collection<? extends GrantedAuthority> getAuthorities() {
        return null;
    }

    @Override
    public String getPassword() {
        return null;
    }

    @Override
    public String getUsername() {
        return null;
    }

    @Override
    public boolean isAccountNonExpired() {
        return false;
    }

    @Override
    public boolean isAccountNonLocked() {
        return false;
    }

    @Override
    public boolean isCredentialsNonExpired() {
        return false;
    }

    @Override
    public boolean isEnabled() {
        return false;
    }


}
